
 [roomId, setRoomId] = useState('')
//所有楼栋
 const [buildings, setBuildings] = useState('');
const getBuildings = useCallback(async () => {
    const { data } = await request.get('/building/getManageBuildings');
    setBuildings(data.data.buildings);
}, []);
//楼栋选择回调
const handleChangeBuildings = useCallback((_, { key }) => {
    setRooms('');
    getFloors(key);
}, [])

//所有楼层
const [floors, setFloors] = useState('');
const getFloors = useCallback(async id => {
    const { data } = await request.get('/floor/getFloors', { params: { buildingId: id } });
    setFloors(data.data.floors);
}, [buildings]);
//楼层选择回调
const handleChangeFloors = useCallback((_, { key }) => {
    getRooms(key);
}, [])

//所有房间
const [rooms, setRooms] = useState('');
const getRooms = useCallback(async id => {
    const { data } = await request.get('/room/getRooms', { params: { floorId: id } });
    setRooms(data.data.rooms);
}, []);
//房间选择回调
const handleChangeRooms = useCallback((_, { key }) => {
    setRoomId(key)
}, [])
// 获取单个房间
const [roomInfo, setRoomInfo] = useState({});
const getRoomInfo = useCallback(async id => {
    const { data } = await request.get('/room/getRoomInfo', { params: { roomId: id } });
    console.log(data);
    setRoomInfo(data.data);
}, []);
//获取按钮回调
const getInfo = useCallback(() => {
    getRoomInfo(roomId);
    // getEvaluates(roomId)
}, [roomId])

